package cn.wx.scholar.core.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import cn.wx.common.persistence.base.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import cn.wx.scholar.core.service.PaperService;
import cn.wx.scholar.core.entity.Paper;
import cn.wx.common.persistence.web.ResponseData;
import cn.wx.scholar.core.entity.qo.PaperQ;
/**
 *   @description : Paper 控制器
 *   ---------------------------------
 *   @author  
 *   @since 2018-07-17
 */
@RestController
@RequestMapping("/sholar/paper")
public class PaperController extends BaseController {

    @Autowired
    private PaperService paperService;

    /**
     * @description : 通过条件获取Paper
     * ---------------------------------
     * @author :  
     * @since : Create in 2018-07-17
     */
    @RequestMapping(value = "/query/unique", method = RequestMethod.POST)
    public ResponseData queryUnique(PaperQ paperQ) throws Exception {
        return success(paperService.queryUnique(paperQ,Paper.class));
    }

    /**
     * @description : 通过条件获取Paper分页
     * ---------------------------------
     * @author :  
     * @since : Create in 2018-07-17
     */
    @RequestMapping(value = "/query/page", method = RequestMethod.POST)
    public ResponseData queryPage(PaperQ paperQ) throws Exception {
        return success(paperService.queryPage(paperQ));
    }

}